package xpn.platform.common.persistence;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * 带时间  审计  实体基类
 *
 * @author duwei
 */
@MappedSuperclass
@EntityListeners(AuditingEntityListener.class)
@Getter
@Setter
public abstract class AbstractBaseEntity<Long> extends AbstractEntity {

    private static final long serialVersionUID = -5406482500683404541L;

    @CreatedDate
    private Date createdTime;

    @LastModifiedDate
    private Date modifiedTime;
}
